home *** CD-ROM | disk | FTP | other *** search
- /* memccpy.c, from p.148 of Turbo C Bible */
- /* Copies bytes from one buffer to another until specific character is
- encountered or until a specified number of bytes have been copied.*/
- #include <stdio.h>
- #include <mem.h>
- static char dest[81]; /* Destination buffer */
- main()
- {
- char inbuf[81];
- printf("Enter a string: ");
- gets(inbuf);
- memccpy(dest, inbuf, '\0', 81);
- printf("Destination buffer has: %s\n", dest);
- }